/**
 * 
 */
package org.higginsexamples.multiusermail.rcpmail;

import java.util.ArrayList;

class Mailbox extends Folder {
	private ArrayList children;

	public Mailbox(String name) {
		super(name);
		children = new ArrayList();
	}

	public void addChild(Folder child) {
		children.add(child);
		child.setParent(this);
	}

	public void removeChild(Folder child) {
		children.remove(child);
		child.setParent(null);
	}

	public Folder[] getChildren() {
		return (Folder[]) children.toArray(new Folder[children.size()]);
	}

	public boolean hasChildren() {
		return children.size() > 0;
	}
}